package AbstractClass.AbstractClassDome001;

/**
 * ClassName:Person
 * Package:AbstractClass
 * Description:
 *
 * @Author:ZhangXin
 * @Create2023/1/24-19:00
 * @Version:v1.0
 */

    //抽象类
    //抽象方法
public abstract class Person {
    private String name;
    private int age;

    //作用：当创建子类对象的时候,给属性进行赋值的
    public Person() {
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public abstract void work();
    //抽象类中不一定有抽象方法,有抽象方法的类一定是抽象类
    public void sleep(){

    }
}
